package com.nowcoder.chapter3.part37;

import java.util.HashSet;
import java.util.LinkedHashSet;

/**
 * HashSet
 */
public class SetDemo1 {

    public static void main(String[] args) {
        HashSet students = new HashSet();
        students.add("唐僧");
        students.add("悟空");
        students.add("八戒");
        students.add("唐僧"); // false
        students.add(null);
        System.out.println(students);

        LinkedHashSet teachers = new LinkedHashSet();
        teachers.add("刘备");
        teachers.add("关羽");
        teachers.add("张飞");
        teachers.add("刘备"); // false
        teachers.add(null);
        System.out.println(teachers);
    }

}
